package com.maptasksolver.struct.graph;

import java.util.List;

import com.maptasksolver.exceptions.WrongParameter;

public class Path {
	
	int[] vertexes;
	double pathLen;
	
	public Path(List<Integer> pathFinal, double pathLen) {
		int len = pathFinal.size();
		
		vertexes = new int[len];
		
		for (int i = 0; i < len; ++i)
			vertexes[i] = pathFinal.get(i);
		
		this.pathLen = pathLen;
	}
	
	public int getVertex(int i) throws WrongParameter {
		if (i < 0 || i >= vertexes.length) 
			throw new WrongParameter();
		
		return vertexes[i];
	}
	
	public double getLength() {
		return pathLen;
	}
	
	public int getCount() {
		return vertexes.length;
	}
	
}
